home *** CD-ROM | disk | FTP | other *** search
- /* CSPPP.CMD */
- '@echo off'
- hangflg = 'f:\bbs\logs\hangup.flg' /* hangup flag */
- flg = 'f:\bbs\logs\ppp.flg' /* process flag */
- tcpbin = 'd:\tcpip\bin'
- signal on halt
-
- share = 'OS2ENVIRONMENT'
- Task = value('Task',,share) /* You need to SET TASK = in your mailer's cmd */
-
- if RxFuncQuery("SysLoadFuncs") then
- do
- rc = RxFuncAdd("SysLoadFuncs","RexxUtil","SysLoadFuncs")
- rc = SysLoadFuncs()
- end
-
- if RxFuncQuery("rexxlibregister") then
- do
- rc = RxFuncAdd('rexxlibregister','rexxlib','rexxlibregister')
- rc = rexxlibregister()
- end
-
- IF Stream(flg,'C', 'Query Exists') <>' ' Then
- Do
- say '!Must be running already.'
- exit
- end
- else
- do
- rc=doscreat(flg) /* Set process flag */
- IF rc <> 1 Then
- Do
- say '!Error creating flagfile.'
- exit
- end
- end
-
- del hangflg' > nul: 2>&1'
-
- call syssleep 3
- New = Directory(tcpbin)
-
- do forever
-
- if task = 01 then do
- 'set MinCarrier = 24000'
- 'ppp.exe com2 57600 rtscts modem defaultroute exit notify connect "pppdial.cmd csppp.rsp"'
- end
- else do
- 'set MinCarrier = 14400'
- 'ppp.exe com3 38400 rtscts modem defaultroute exit notify connect "pppdial.cmd csppp2.rsp"'
- end
-
- say 'PPP return code' rc
- IF Stream(hangflg,'C', 'Query Exists') <>' ' Then
- Do
- say '!Time to go!!!!!'
- signal halt
- end
- say 'Sleeping 60 secs. before restarting PPP.'
- call syssleep 60
- end
-
- halt:
- say 'Sleeping 60 sec. before shutting down.'
- call syssleep 60
-
- /* remove process flag */
- 'del 'flg '> nul: 2>&1'
- IF rc <> 0 Then say '!Error deleting 'flg''
-
- 'del 'hangflg '> nul: 2>&1'
- IF rc <> 0 Then say '!Error deleting 'hangflg''
- exit
-
-